This is an example of using RadarSimPy to get the radar cross section (RCS) of a 3-D object model. Ray-Tracing/Shoot-and-Bounce-Rays method is used in RadarSimPy. The algorithm is highly optimized with C/C++ to reduce the execution time.
RadarSimPyis a radar simulation package built with python. Contact me if you are interested in this module.
This notebook is available on my GitHub.
The corner reflector model is with .stl. It can be imported by using numpy-stl module.
import numpy as np
from stl import mesh
import plotly.graph_objs as go
mesh_data = mesh.Mesh.from_file('cr.stl')
x = np.ravel(mesh_data.vectors[:, :, 0])
y = np.ravel(mesh_data.vectors[:, :, 1])
z = np.ravel(mesh_data.vectors[:, :, 2])
cr = go.Mesh3d(x=x, y=y, z=z, opacity=1,
i=np.arange(0, np.shape(mesh_data.vectors)[0]*3, 3),
j=np.arange(1, np.shape(mesh_data.vectors)[0]*3, 3),
k=np.arange(2, np.shape(mesh_data.vectors)[0]*3, 3),
)
fig = go.Figure(data=[cr])
fig.show()
The RCS calculation function is rcs_sbr
from radarsimpy import rcs_sbr
Define the basic parameters required in ray tracing.
phi (Degree)theta (Degree)freq (Hz)poldensity (number of rays per wavelength)import time
phi = 180
theta = 90
freq = np.arange(1, 78, 1)*1e9
pol = [0, 0, 1]
density = 10
rcs = np.zeros_like(freq)
tic = time.time()
for f_idx, f in enumerate(freq):
rcs[f_idx] = 10*np.log10(rcs_sbr('cr.stl', phi,
theta, f, pol=pol, density=density))
toc = time.time()
Execution time with Microsoft Surface Pro (Intel Core i5-7300U, 8 GB RAM)
print('Execution time:', toc-tic, 's')
data = go.Scatter(x=freq/1e9, y=rcs)
layout = go.Layout(
title='RCS vs Frequency',
yaxis=dict(title='RCS (dBsm)'),
xaxis=dict(title='Frequency (GHz)'),
)
go.Figure(data=data, layout=layout)
phi = np.arange(135, 226, 0.5)
theta = 90
freq = 60e9
pol = [0, 0, 1]
density = 10
rcs = np.zeros_like(phi)
tic = time.time()
for phi_idx, phi_ang in enumerate(phi):
rcs[phi_idx] = 10 * \
np.log10(rcs_sbr('cr.stl', phi_ang, theta, freq, pol=pol, density=density))
toc = time.time()
Execution time with Microsoft Surface Pro (Intel Core i5-7300U, 8 GB RAM)
print('Execution time:', toc-tic, 's')
data = go.Scatter(x=phi, y=rcs)
layout = go.Layout(
title='RCS vs Observation Angle',
yaxis=dict(title='RCS (dBsm)'),
xaxis=dict(title='Observation angle phi (Degree)'),
)
go.Figure(data=data, layout=layout)
mesh_data = mesh.Mesh.from_file('audi_r8.stl')
x = np.ravel(mesh_data.vectors[:, :, 0])
y = np.ravel(mesh_data.vectors[:, :, 1])
z = np.ravel(mesh_data.vectors[:, :, 2])
audi = go.Mesh3d(x=x, y=y, z=z, opacity=1,
i=np.arange(0, np.shape(mesh_data.vectors)[0]*3, 3),
j=np.arange(1, np.shape(mesh_data.vectors)[0]*3, 3),
k=np.arange(2, np.shape(mesh_data.vectors)[0]*3, 3),
)
fig = go.Figure(data=[audi])
fig.show()
phi = np.arange(0, 360, 1)
theta = 90
freq = 1.5e9
pol = [0, 0, 1]
density = 10
rcs = np.zeros_like(phi)
tic = time.time()
for phi_idx, phi_ang in enumerate(phi):
rcs[phi_idx] = 10 * \
np.log10(rcs_sbr('audi_r8.stl', phi_ang, theta, freq, pol=pol, density=density))
toc = time.time()
Execution time with Microsoft Surface Pro (Intel Core i5-7300U, 8 GB RAM)
print('Execution time:', toc-tic, 's')
data = go.Scatter(x=phi, y=rcs)
layout = go.Layout(
title='RCS vs Observation Angle',
yaxis=dict(title='RCS (dBsm)'),
xaxis=dict(title='Observation angle phi (Degree)'),
)
go.Figure(data=data, layout=layout)